/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.StateVariables.impl;

import EA_Model.IEC61970.Domain.ApparentPower;

import EA_Model.IEC61970.StateVariables.StateVariablesPackage;
import EA_Model.IEC61970.StateVariables.SvShortCircuit;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Sv Short Circuit</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.StateVariables.impl.SvShortCircuitImpl#getR0PerR <em>R0 Per R</em>}</li>
 *   <li>{@link EA_Model.IEC61970.StateVariables.impl.SvShortCircuitImpl#getSShortCircuit <em>SShort Circuit</em>}</li>
 *   <li>{@link EA_Model.IEC61970.StateVariables.impl.SvShortCircuitImpl#getX0PerX <em>X0 Per X</em>}</li>
 *   <li>{@link EA_Model.IEC61970.StateVariables.impl.SvShortCircuitImpl#getXPerR <em>XPer R</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class SvShortCircuitImpl extends StateVariableImpl implements SvShortCircuit {
	/**
	 * The cached value of the '{@link #getR0PerR() <em>R0 Per R</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getR0PerR()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float r0PerR;

	/**
	 * The cached value of the '{@link #getSShortCircuit() <em>SShort Circuit</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSShortCircuit()
	 * @generated
	 * @ordered
	 */
	protected ApparentPower sShortCircuit;

	/**
	 * The cached value of the '{@link #getX0PerX() <em>X0 Per X</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getX0PerX()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float x0PerX;

	/**
	 * The cached value of the '{@link #getXPerR() <em>XPer R</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getXPerR()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float xPerR;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected SvShortCircuitImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return StateVariablesPackage.Literals.SV_SHORT_CIRCUIT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getR0PerR() {
		if (r0PerR != null && r0PerR.eIsProxy()) {
			InternalEObject oldR0PerR = (InternalEObject)r0PerR;
			r0PerR = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldR0PerR);
			if (r0PerR != oldR0PerR) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, StateVariablesPackage.SV_SHORT_CIRCUIT__R0_PER_R, oldR0PerR, r0PerR));
			}
		}
		return r0PerR;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetR0PerR() {
		return r0PerR;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setR0PerR(EA_Model.IEC61970.Domain.Float newR0PerR) {
		EA_Model.IEC61970.Domain.Float oldR0PerR = r0PerR;
		r0PerR = newR0PerR;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, StateVariablesPackage.SV_SHORT_CIRCUIT__R0_PER_R, oldR0PerR, r0PerR));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ApparentPower getSShortCircuit() {
		if (sShortCircuit != null && sShortCircuit.eIsProxy()) {
			InternalEObject oldSShortCircuit = (InternalEObject)sShortCircuit;
			sShortCircuit = (ApparentPower)eResolveProxy(oldSShortCircuit);
			if (sShortCircuit != oldSShortCircuit) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, StateVariablesPackage.SV_SHORT_CIRCUIT__SSHORT_CIRCUIT, oldSShortCircuit, sShortCircuit));
			}
		}
		return sShortCircuit;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ApparentPower basicGetSShortCircuit() {
		return sShortCircuit;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSShortCircuit(ApparentPower newSShortCircuit) {
		ApparentPower oldSShortCircuit = sShortCircuit;
		sShortCircuit = newSShortCircuit;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, StateVariablesPackage.SV_SHORT_CIRCUIT__SSHORT_CIRCUIT, oldSShortCircuit, sShortCircuit));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getX0PerX() {
		if (x0PerX != null && x0PerX.eIsProxy()) {
			InternalEObject oldX0PerX = (InternalEObject)x0PerX;
			x0PerX = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldX0PerX);
			if (x0PerX != oldX0PerX) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, StateVariablesPackage.SV_SHORT_CIRCUIT__X0_PER_X, oldX0PerX, x0PerX));
			}
		}
		return x0PerX;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetX0PerX() {
		return x0PerX;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setX0PerX(EA_Model.IEC61970.Domain.Float newX0PerX) {
		EA_Model.IEC61970.Domain.Float oldX0PerX = x0PerX;
		x0PerX = newX0PerX;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, StateVariablesPackage.SV_SHORT_CIRCUIT__X0_PER_X, oldX0PerX, x0PerX));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getXPerR() {
		if (xPerR != null && xPerR.eIsProxy()) {
			InternalEObject oldXPerR = (InternalEObject)xPerR;
			xPerR = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldXPerR);
			if (xPerR != oldXPerR) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, StateVariablesPackage.SV_SHORT_CIRCUIT__XPER_R, oldXPerR, xPerR));
			}
		}
		return xPerR;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetXPerR() {
		return xPerR;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setXPerR(EA_Model.IEC61970.Domain.Float newXPerR) {
		EA_Model.IEC61970.Domain.Float oldXPerR = xPerR;
		xPerR = newXPerR;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, StateVariablesPackage.SV_SHORT_CIRCUIT__XPER_R, oldXPerR, xPerR));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case StateVariablesPackage.SV_SHORT_CIRCUIT__R0_PER_R:
				if (resolve) return getR0PerR();
				return basicGetR0PerR();
			case StateVariablesPackage.SV_SHORT_CIRCUIT__SSHORT_CIRCUIT:
				if (resolve) return getSShortCircuit();
				return basicGetSShortCircuit();
			case StateVariablesPackage.SV_SHORT_CIRCUIT__X0_PER_X:
				if (resolve) return getX0PerX();
				return basicGetX0PerX();
			case StateVariablesPackage.SV_SHORT_CIRCUIT__XPER_R:
				if (resolve) return getXPerR();
				return basicGetXPerR();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case StateVariablesPackage.SV_SHORT_CIRCUIT__R0_PER_R:
				setR0PerR((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case StateVariablesPackage.SV_SHORT_CIRCUIT__SSHORT_CIRCUIT:
				setSShortCircuit((ApparentPower)newValue);
				return;
			case StateVariablesPackage.SV_SHORT_CIRCUIT__X0_PER_X:
				setX0PerX((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case StateVariablesPackage.SV_SHORT_CIRCUIT__XPER_R:
				setXPerR((EA_Model.IEC61970.Domain.Float)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case StateVariablesPackage.SV_SHORT_CIRCUIT__R0_PER_R:
				setR0PerR((EA_Model.IEC61970.Domain.Float)null);
				return;
			case StateVariablesPackage.SV_SHORT_CIRCUIT__SSHORT_CIRCUIT:
				setSShortCircuit((ApparentPower)null);
				return;
			case StateVariablesPackage.SV_SHORT_CIRCUIT__X0_PER_X:
				setX0PerX((EA_Model.IEC61970.Domain.Float)null);
				return;
			case StateVariablesPackage.SV_SHORT_CIRCUIT__XPER_R:
				setXPerR((EA_Model.IEC61970.Domain.Float)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case StateVariablesPackage.SV_SHORT_CIRCUIT__R0_PER_R:
				return r0PerR != null;
			case StateVariablesPackage.SV_SHORT_CIRCUIT__SSHORT_CIRCUIT:
				return sShortCircuit != null;
			case StateVariablesPackage.SV_SHORT_CIRCUIT__X0_PER_X:
				return x0PerX != null;
			case StateVariablesPackage.SV_SHORT_CIRCUIT__XPER_R:
				return xPerR != null;
		}
		return super.eIsSet(featureID);
	}

} //SvShortCircuitImpl
